﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using ObjectLayer;
using System.Web.Script.Services;
using System.Web.Script.Serialization;

namespace BSC.report
{
    /// <summary>
    /// Summary description for ServiceReports
    /// </summary>
    [WebService(Namespace = "VNPT")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
    
    [System.Web.Script.Services.ScriptService]
    public class ServiceReports : System.Web.Services.WebService
    {
        
        [System.Web.Script.Services.ScriptMethod(ResponseFormat = ResponseFormat.Json)]
        [WebMethod]
        public string GetCost()
        {
            List<ObjectLayer.fact_costs_revenuesBO> lst = new List<ObjectLayer.fact_costs_revenuesBO>();
            lst = AccessLayer.fact_costs_revenuesDAO.Get(null,null);
            //Context.Response.Write(new JavaScriptSerializer().Serialize(lst));
            var tmp = Newtonsoft.Json.JsonConvert.SerializeObject(lst, Newtonsoft.Json.Formatting.Indented); //"adsdasdasds";
          
            return  tmp;// +"dsdasd";// new JavaScriptSerializer().Serialize(lst.ToArray());//Newtonsoft.Json.JsonConvert.SerializeObject(lst);
        }
    }
}
